|
Menu location |
---|
Part → Primitives → Cube |
Workbenches |
Part |
Default shortcut |
None |
Introduced in version |
- |
See also |
Part Primitives |
利用零件工作台(Part Workbench)中的立方体命令可向处于活动状态的文档中插入一个参数化 长方体几何图元。默认情况下,此立方体命令会在原点处插入一个10x10x10 mm且附有"cube"标签的立方体。在添加立方体对象后还可以修改这些参数。
A Part Box object created with the scripting example below is shown here.
See also: Property editor.
A Part Box object is derived from a Part Feature object and inherits all its properties. It also has the following additional properties:
Attachment
The object has the same attachment properties as a Part Part2DObject.
Box
Box
See also: Autogenerated API documentation, Part scripting and FreeCAD Scripting Basics.
通过下列函数即可在宏以及python控制台中使用立方体命令:
box = FreeCAD.ActiveDocument.addObject("Part::Box", "myBox")
Example:
import FreeCAD as App
doc = App.activeDocument()
box = doc.addObject("Part::Box", "myBox")
box.Length = 4
box.Width = 8
box.Height = 12
box.Placement = App.Placement(App.Vector(1, 2, 3), App.Rotation(75, 60, 30))
doc.recompute()